package com.bulemobi.activity.ac_user_centre;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.bulemobi.net.tsz.afinal.annotation.view.ViewInject;
import com.bulemobi.view.BaseActivity;
import com.bulemobi.view.PictrueDetailsView;
import com.bulemobi.view.titleView.ActionBarView;
import com.jsyh.hcb.R;

/**
 * @author zengys  图片详情
 *         <p/>
 *         <p/>
 *         2014年9月18日 13:36:06
 */
public class PictrueDetalisActivity extends BaseActivity implements OnClickListener {

    PictrueDetailsView view;
    @ViewInject(id = R.id.actionBar)
    ActionBarView actionBarView;
    @ViewInject(id = R.id.bt_share)
    Button bt_share;
    @ViewInject(id = R.id.lay_share)
    RelativeLayout lay_share;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_pictrue_details);
        findActionBar();
    }

    private void findActionBar() {
        lay_share.setVisibility(View.GONE);
        bt_share.setOnClickListener(this);
        actionBarView.title.setText(getResources().getText(R.string.tupingxingqing));
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode == KeyEvent.KEYCODE_BACK){
            if(lay_share.getVisibility()==View.VISIBLE){
                lay_share.setVisibility(View.GONE);
                return true;
            }else {
                return false;
            }
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_share:
                if(lay_share.getVisibility()==View.GONE){
                    lay_share.setVisibility(View.VISIBLE);
                }else {
                    lay_share.setVisibility(View.GONE);
                }
                break;

            default:
                break;
        }
    }

}
